/**
 * 
 */
package com.starhub.sample.entities;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @author Hoan.NguyenTrong Jan 7, 2015
 * 
 */
@Entity
@Table(name = "tab")
public class Tab {

    private static final String TAB = "tab";
    private Long id;
    private String title;
    private List<TabTile> tabTiles;

    public Tab() {
    }

    @Id
    @Column(name = "id", unique = true, nullable = false)
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
	return id;
    }

    public void setId(Long id) {
	this.id = id;
    }

    @Column(name = "title", length = 1000)
    public String getTitle() {
	return title;
    }

    public void setTitle(String title) {
	this.title = title;
    }

    @OneToMany(fetch = FetchType.EAGER, mappedBy = Tab.TAB, cascade = CascadeType.ALL)
    public List<TabTile> getTabTiles() {
	return tabTiles;
    }

    public void setTabTiles(List<TabTile> tabTiles) {
	this.tabTiles = tabTiles;
    }
}
